﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master1.Master" AutoEventWireup="true" CodeBehind="Categories.aspx.cs" Inherits="TienTeTuong.Categories" %>
<%@ Import Namespace="TienTeTuong" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
                <div>
                    	<div class="mainTitle">Danh mục sản phẩm</div>
                        <div class="mainBrowse">Trở về: <a href="Home.aspx">Trang chủ</a></div>
                        <div class="Content mainProduct">
                        <!-- Products -->
                            <div class="mainProductListB">
                        	<div class="mainProductListC">
                                <% foreach (var cateDTO in lstCate)
                                   {
                                       maxPerLine++;
                                       //  var cateDetailBUS = new CategoryDetailBUS();
                                       // var cateDetailDTO = cateDetailBUS.GetListCategoryDetailByCateID(cateDTO.CateID);
%>
                            	        <div class="mainProductTD">
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                	        <tr>
                                                <td class="mainProductTDImg">
                                                    <a href="CategoryDetail.aspx?CateID=<%=cateDTO.CateID%>">
                                                        <div class ="Hover"><%=cateDTO.Description %></div>
                                                        <img src="<%=cateDTO.Image%>" alt=""/>
                                                    </a>
                                	            </td>
                                	        </tr>
                                            <tr><td class="Title"><a href="CategoryDetail.aspx?CateID=<%=cateDTO.CateID%>"><%=cateDTO.CateName%></a></td></tr>
                                        </table></div>
                                            <% if (maxPerLine < 3)
{ %>
                                               <div class="mainProductTDSpace"></div>
                                             <% } %>                                   

                       
                                <% if (maxPerLine == 3)
                                    {
                                    maxPerLine = 0; %>
                                     <div class="clear"></div>
                                 <% } %>
                                <% } // end foreach
                                    %>                             
                        
                            </div>
                            </div>
                            <!--Paging-->
                            <%if (iTotalPage > 1)
                              {%>
                               <div class="clear"></div>
                                 <div class="pageNumber">
                                
                            	<a href="Categories.aspx?page=1">&laquo; Trang đầu</a>
                                 <%for (var i = iLowerPage; i <= iUpperPage; i++)
                                {%>  
                                  <%if (i != iCurPage)
{%>
                                     <a href="Categories.aspx?page=<%=i.ToString() %>" class="Number"><%=i.ToString() %></a>
                                  <% } else{%>
                                     <a href="#" class="Current"><%=i.ToString() %></a>
                                 <% } %>
                                <% } %> 
                                <a href="Categories.aspx?page=<%=iTotalPage %>">Trang cuối &raquo;</a>

                                <div class="clear"></div>
                               </div>
                            <% } %>
                             <!--End Paging-->
                        <!-- Best Seller -->
                            <%if (lstCateDetail.Count > 0)
                              { %>
                        	<div class="mainProductHot">
                            	<div class="Title">Sản phẩm bán chạy</div>
                                <div class="mainProductHotBgB"><div class="mainProductHotBgT">
                                <% foreach (var val in lstCateDetail)
                                   {
                                       maxPerLineHot++; %>
                            	
                                    <div class="mainProductTD"><table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td class="mainProductTDImg">
                                                <a href="productDetail.aspx?CateDetailID=<%= val.CateDetailID %>&CateID=<%= val.CateID %>">
                                                    <img src="<%= val.Image %>" alt =""/>
                                                </a>

                                            </td></tr>
                                        <tr><td class="Title"><a href="productDetail.aspx?CateDetailID=<%= val.CateDetailID %>&CateID=<%= val.CateID %>"><%= val.Name %></a></td></tr>
                                    </table></div>
                                    <% if (maxPerLineHot < 3)
                                       { %>
                                               <div class="mainProductTDSpace"></div>
                                     <% } %>                          
                                    

                                    <% if (maxPerLineHot == 3)
                                       {
                                           maxPerLineHot = 0; %>  
                                     <div class="clear"></div>
                                 <% } %>

                                    <% } %>
                                    <div class="clear"></div>
                                </div></div>
                            </div>
                            <% } %>
                        </div>
                    </div>
    <script language="javascript" src="js/Categories.js"></script>
</asp:Content>


